<?php
//--2017_1_24--评论控制器
namespace Home\Controller;
// use Think\Controller;
class CommentController extends EmptyController {
   //执行写进评论表操作
   public function add(){
        //获取用户提交值
        $data = I('post.');
        $data['addtime'] = time();
        $data['level'] = 5;
        //实例化commnet表
        $comment = M('comment');
        $res = $comment->add($data);
        if($res){
            $this->success('评论成功',U('Home/Member/Member_comment'));
        }else{
            $this->error('评论失败');
        }
   }
}